home *** CD-ROM | disk | FTP | other *** search
/ Master Visual Basic 3 / Master Visual Basic 3 (SAMS Publishing) (1994).ISO / mvprog / original / ch11 / myicon.bas next >
Encoding:
BASIC Source File  |  1994-03-19  |  584 b   |  32 lines

  1. Option Explicit
  2.  
  3. Sub Main ()
  4.  
  5.    Dim XPos, YPos
  6.    
  7.    frmMyIcon.Show
  8.  
  9.    Do While DoEvents()
  10.  
  11.       ' Set current position to center of the form
  12.       frmMyIcon.CurrentX = frmMyIcon.ScaleWidth / 2
  13.       frmMyIcon.CurrentY = frmMyIcon.ScaleHeight / 2
  14.  
  15.       
  16.       ' Set thickness of the line
  17.       frmMyIcon.DrawWidth = 1
  18.     
  19.       'Set the point coordinates
  20.       XPos = Rnd * frmMyIcon.ScaleWidth
  21.       YPos = Rnd * frmMyIcon.ScaleHeight
  22.     
  23.       ' Draw the line
  24.       frmMyIcon.Line -(XPos, YPos), QBColor(Rnd * 15)
  25.     
  26.     
  27.     Loop
  28.  
  29.  
  30. End Sub
  31.  
  32.